package com.example.springbolgdemo.common.util;

import com.example.springbolgdemo.pojo.dataobject.UserInfo;
import com.example.springbolgdemo.pojo.response.UserInfoResponse;
import org.springframework.beans.BeanUtils;

public class BeanTransformUtils {
    /**
     * 将UserInfo转换为UserInfoResponse.
     * @param userInfo
     * @return
     */
    public static UserInfoResponse trans(UserInfo userInfo){
        UserInfoResponse userInfoResponse=new UserInfoResponse();
        BeanUtils.copyProperties(userInfo,userInfoResponse);
        return userInfoResponse;
    }
}
